(function() {
  'use strict';

  angular
    .module('hp')
    .controller('RootController', RootController)
    .controller('MainController', MainController);

    function RootController(MyAuth,$rootScope){
        var vm = this;
        vm.className = 'mini-hide';
        vm.isLogin = MyAuth.loggedIn();
        $rootScope.isLogin = MyAuth.loggedIn();
        vm.toggleNav = toggleNav;


        function toggleNav(){
          if(vm.className == 'mini-hide'){
            vm.className = 'mini-show';
          }else{
            vm.className='mini-hide'
          }
        }
    }
  /** @ngInject */
  function MainController($timeout, webDevTec, toastr,$rootScope,$state,MyAuth) {
    var vm = this;
    vm.isLogin = MyAuth.loggedIn();
    // alert(vm.isLogin)
    // vm.awesomeThings = [];
    // vm.classAnimation = '';
    vm.creationDate = 1479262134756;
    vm.go = go;

    function go(){
        $state.go('machinecode')
    }

    // activate();

    // function activate() {
    //   getWebDevTec();
    //   $timeout(function() {
    //     vm.classAnimation = 'rubberBand';
    //   }, 4000);
    // }

    // function showToastr() {
    //   toastr.info('Fork <a href="https://github.com/" target="_blank"><b>github</b></a>');
    //   // vm.classAnimation = '';
    // }

    // function getWebDevTec() {
    //   vm.awesomeThings = webDevTec.getTec();

    //   angular.forEach(vm.awesomeThings, function(awesomeThing) {
    //     awesomeThing.rank = Math.random();
    //   });
    // }
  }
})();
